<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>"/>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
			 $(function(){
				 $(".xinz").linkbutton({onClick:function(){ 
						$("#p").panel({
							href:'to_staffTurnover_insert'
						});			
					 }});
				 $(".bj").linkbutton({onClick:function(){ 
						$("#p").panel({
							href:'compile_staffTurnover'
						});			
					 }});
				 //删除
				 $(".scstaff").linkbutton({onClick:function(){
						var rowInfo = $("#bgd").datagrid('getSelected');
						if(rowInfo){
							$.messager.confirm('确认', '您确定要删除该条数据吗？', function(v){
								if(v){
									var poBdId = $("#bgd").datagrid("getSelected").PO_BD_ID;
									$.getJSON("delete_staffturnover",{poBdId:poBdId},function(v){
										if(v){
											$('#bgd').datagrid('reload');   
										}else{
											$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
										}
									});
								}
								
							});
						}else{
							$.messager.alert('错误', '对不起，操作失败，没有选中的行');
						}
						
					}});
				//模糊查询
					$(".search_staffturnover").linkbutton({onClick:function(){
						var workName = $(".sox_staffturnover").textbox("getText");
						$("#bgd").datagrid('load', 'find_likeall_staffturnover_mybatis?name=' + workName);
						$(".sox_staffturnover").textbox("setText","");
					}});
				
			}); 
</script>
<div id="p" class="easyui-panel "  
        data-options="fit:true">   
	<table class="easyui-datagrid" id="bgd" data-options="
				url:'select_positionchange',
				pageList:[2,4,6,8,10],
				pageSize:10,
				pagination:true,
				method:'get',
				fitColumns:true,
				fit:true,
				nowrap:false,
				autoRowHeight:true,
				rownumbers:true,
				singleSelect:true,
				striped:true,
				toolbar:'#dd14'
				">
			<thead>
				<tr>
					<th data-options="field:'STAIN_ID',width:50">员工编号</th>
					<th data-options="field:'STAIN_NAME',width:50">员工名称</th>
					<th data-options="field:'VARIATION_POSITION_DATE',width:50,align:'center',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
						return;
				}">变动日期</th>
					<th data-options="field:'YUANZHIWU',width:50,align:'center'">原职务</th>
					<th data-options="field:'XINZHIWU',width:50,align:'center'">新职务</th>
					<th data-options="field:'PO_EXECUTOR',width:50,align:'center'">执行人</th>
					
				</tr> 
			</thead>
			<tbody>
			</tbody>
		</table>
		<div  id="dd14"  >
			<a href="#" class="xinz" data-options="iconCls:'icon-add',plain:true,text:'新增',iconAlign:'left'"></a>| 
                <a href="#" class="bj" data-options="iconCls:'icon-edit',plain:true,text:'编辑',iconAlign:'left'"></a>| 
                <a href="#" class="easyui-linkbutton scstaff" data-options="iconCls:'icon-remove',plain:true,text:'删除',iconAlign:'left'"></a>| 
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true,text:'刷新',iconAlign:'left'"></a>| 
				入司日期从<input type= "text" class= "easyui-datebox" /> 到
				<input type= "text" class= "easyui-datebox" />
				<input class="easyui-textbox sox_staffturnover" data-options="iconCls:'icon-search',prompt:'请输入名字'" style="width:200px"> 
				<a class="easyui-linkbutton search_staffturnover" iconCls="icon-remove" plain="true">搜索</a>
		</div>
		
	</div>
					
</body>
</html>